package com.ccdt.tv.starttvreview;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_lb_heilongjiang).setOnClickListener(this);
        findViewById(R.id.btn_lb_hunan).setOnClickListener(this);
        findViewById(R.id.btn_sy_heilongjiang).setOnClickListener(this);
        findViewById(R.id.btn_sy_hunan).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()){
            case R.id.btn_lb_heilongjiang:
                intent.setClassName("com.ccdt.tv.lookback", "com.ccdt.tv.lookback.view.activity.MainActivity");
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.setAction("playback://voole.playback.uri.start?channelName=黑龙江卫视高清");
                this.startActivity(intent);
                break;
            case R.id.btn_lb_hunan:
                intent.setClassName("com.ccdt.tv.lookback", "com.ccdt.tv.lookback.view.activity.MainActivity");
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.setAction("playback://voole.playback.uri.start?channelName=湖南卫视高清");
                this.startActivity(intent);
                break;
            case R.id.btn_sy_heilongjiang:
                intent.setClassName("com.ccdt.tv.lookback", "com.ccdt.tv.lookback.view.activity.MainActivity");
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.setAction("playback://voole.playback.uri.start?channelName=家庭影院");
                this.startActivity(intent);
                break;
            case R.id.btn_sy_hunan:
                intent.setClassName("com.ccdt.tv.lookback", "com.ccdt.tv.lookback.view.activity.MainActivity");
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.setAction("playback://voole.playback.uri.start?channelName=游戏风云");
                this.startActivity(intent);
                break;
        }
    }
}
